gdkwindow: Do not rely on a previous slave device when updating grab
authorRob Bradford <rob@linux.intel.com>
Wed, 23 Jan 2013 16:55:59 +0000 (16:55 +0000)
committerRob Bradford <rob@linux.intel.com>
Wed, 6 Feb 2013 14:17:46 +0000 (14:17 +0000)
_gdk_display_device_grab_update does not support passing in NULL for the
source device. If we don't have a slave device (saved in the pointer info)
then do not try and use that NULL pointer for the source_device.

This bug appeared in the Wayland backend where we (currently) only have master
devices exposed and as such no slave device is ever saved.

Fixes: https://bugzilla.gnome.org/show_bug.cgi?id=692411
gdk/gdkwindow.c

index 7afcd9697846a5b221843801b81363af859ff25b..1aa11f13cba079c4b31bb8d03444b2a1f0243964 100644 (file)
@@ -9911,7 +9911,7 @@ _gdk_windowing_got_event (GdkDisplay *display,
           if (source_device != pointer_info->last_slave &&
               gdk_device_get_device_type (source_device) == GDK_DEVICE_TYPE_SLAVE)
             pointer_info->last_slave = source_device;
-          else
+          else if (pointer_info->last_slave)
             source_device = pointer_info->last_slave;
         }